package c05_collections_contains;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        Map<String, List<String>> map = new HashMap<>();

        String province1 = "北京";
        List<String> city1= List.of("东城","西城","朝阳");
        map.put(province1,city1);

        String province2 = "上海";
        List<String> city2= List.of("浦东","徐汇","虹口");
        map.put(province2,city2);

        String province3 = "广东";
        List<String> city3= List.of("广州","深圳","珠海");
        map.put(province3,city3);

        Set<Map.Entry<String, List<String>>> entries = map.entrySet();
/*        for (Map.Entry<String, List<String>> entry : entries) {
            String key = entry.getKey();
            List<String> value = entry.getValue();
            System.out.println(key + "------->" + value);
        }*/
        map.forEach((k,v) -> System.out.println(k + "------->" + v));

    }
}
